package com.aaa.entity.common;


import lombok.Data;

@Data
public class AppRst {
    private Integer code;
    private String msg;
    private Object data;



    public static AppRst ok() {
        AppRst appRst = new AppRst();
        appRst.setCode(200);
        return appRst;
    }

    public static AppRst ok(Object data, String msg) {
        AppRst appRst = new AppRst();
        appRst.setCode(200);
        appRst.setData(data);
        appRst.setMsg(msg);
        return appRst;
    }

    public static AppRst error() {
        AppRst appRst = new AppRst();
        appRst.setCode(500);
        return appRst;
    }

    public static AppRst error(Integer code, String msg) {
        AppRst appRst = new AppRst();
        appRst.setCode(code);
        appRst.setMsg(msg);
        return appRst;
    }
}
